消防栓水管
This commit is contained in:
parent
b6f66918b3
commit
4c8f51270e
@ -3656,6 +3656,126 @@ Animator:
|
|||||||
m_CorrespondingSourceObject: {fileID: 5866666021909216657, guid: b4bc8a6718ad365439657b4dace25c94, type: 3}
|
m_CorrespondingSourceObject: {fileID: 5866666021909216657, guid: b4bc8a6718ad365439657b4dace25c94, type: 3}
|
||||||
m_PrefabInstance: {fileID: 272025129}
|
m_PrefabInstance: {fileID: 272025129}
|
||||||
m_PrefabAsset: {fileID: 0}
|
m_PrefabAsset: {fileID: 0}
|
||||||
|
--- !u!1 &272591050
|
||||||
|
GameObject:
|
||||||
|
m_ObjectHideFlags: 0
|
||||||
|
m_CorrespondingSourceObject: {fileID: 0}
|
||||||
|
m_PrefabInstance: {fileID: 0}
|
||||||
|
m_PrefabAsset: {fileID: 0}
|
||||||
|
serializedVersion: 6
|
||||||
|
m_Component:
|
||||||
|
- component: {fileID: 272591055}
|
||||||
|
- component: {fileID: 272591054}
|
||||||
|
- component: {fileID: 272591053}
|
||||||
|
- component: {fileID: 272591052}
|
||||||
|
- component: {fileID: 272591051}
|
||||||
|
m_Layer: 0
|
||||||
|
m_Name: shuiguan
|
||||||
|
m_TagString: Untagged
|
||||||
|
m_Icon: {fileID: 0}
|
||||||
|
m_NavMeshLayer: 0
|
||||||
|
m_StaticEditorFlags: 0
|
||||||
|
m_IsActive: 1
|
||||||
|
--- !u!114 &272591051
|
||||||
|
MonoBehaviour:
|
||||||
|
m_ObjectHideFlags: 0
|
||||||
|
m_CorrespondingSourceObject: {fileID: 0}
|
||||||
|
m_PrefabInstance: {fileID: 0}
|
||||||
|
m_PrefabAsset: {fileID: 0}
|
||||||
|
m_GameObject: {fileID: 272591050}
|
||||||
|
m_Enabled: 1
|
||||||
|
m_EditorHideFlags: 0
|
||||||
|
m_Script: {fileID: 11500000, guid: ad01dad0cc1e4a04a932125df88f1edd, type: 3}
|
||||||
|
m_Name:
|
||||||
|
m_EditorClassIdentifier:
|
||||||
|
cornerScale: 0.01
|
||||||
|
cornerStep: 22
|
||||||
|
circleStep: 29
|
||||||
|
r: 0.05
|
||||||
|
point1: {fileID: 0}
|
||||||
|
point1Dir: {x: 0, y: 1, z: 0}
|
||||||
|
point2: {fileID: 0}
|
||||||
|
point2Dir: {x: 0, y: 1, z: 0}
|
||||||
|
update: 1
|
||||||
|
mesh: {fileID: 1398298638}
|
||||||
|
--- !u!65 &272591052
|
||||||
|
BoxCollider:
|
||||||
|
m_ObjectHideFlags: 0
|
||||||
|
m_CorrespondingSourceObject: {fileID: 0}
|
||||||
|
m_PrefabInstance: {fileID: 0}
|
||||||
|
m_PrefabAsset: {fileID: 0}
|
||||||
|
m_GameObject: {fileID: 272591050}
|
||||||
|
m_Material: {fileID: 0}
|
||||||
|
m_IsTrigger: 0
|
||||||
|
m_Enabled: 1
|
||||||
|
serializedVersion: 2
|
||||||
|
m_Size: {x: 1, y: 1, z: 1}
|
||||||
|
m_Center: {x: 0, y: 0, z: 0}
|
||||||
|
--- !u!23 &272591053
|
||||||
|
MeshRenderer:
|
||||||
|
m_ObjectHideFlags: 0
|
||||||
|
m_CorrespondingSourceObject: {fileID: 0}
|
||||||
|
m_PrefabInstance: {fileID: 0}
|
||||||
|
m_PrefabAsset: {fileID: 0}
|
||||||
|
m_GameObject: {fileID: 272591050}
|
||||||
|
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_RenderingLayerMask: 1
|
||||||
|
m_RendererPriority: 0
|
||||||
|
m_Materials:
|
||||||
|
- {fileID: 10303, guid: 0000000000000000f000000000000000, type: 0}
|
||||||
|
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!33 &272591054
|
||||||
|
MeshFilter:
|
||||||
|
m_ObjectHideFlags: 0
|
||||||
|
m_CorrespondingSourceObject: {fileID: 0}
|
||||||
|
m_PrefabInstance: {fileID: 0}
|
||||||
|
m_PrefabAsset: {fileID: 0}
|
||||||
|
m_GameObject: {fileID: 272591050}
|
||||||
|
m_Mesh: {fileID: 1398298638}
|
||||||
|
--- !u!4 &272591055
|
||||||
|
Transform:
|
||||||
|
m_ObjectHideFlags: 0
|
||||||
|
m_CorrespondingSourceObject: {fileID: 0}
|
||||||
|
m_PrefabInstance: {fileID: 0}
|
||||||
|
m_PrefabAsset: {fileID: 0}
|
||||||
|
m_GameObject: {fileID: 272591050}
|
||||||
|
m_LocalRotation: {x: 0, y: 0, z: 0, w: 1}
|
||||||
|
m_LocalPosition: {x: -9.029114, y: 0.93000007, z: 32.63}
|
||||||
|
m_LocalScale: {x: 1, y: 1, z: 1}
|
||||||
|
m_ConstrainProportionsScale: 0
|
||||||
|
m_Children: []
|
||||||
|
m_Father: {fileID: 0}
|
||||||
|
m_RootOrder: 35
|
||||||
|
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
|
||||||
--- !u!1001 &285549842
|
--- !u!1001 &285549842
|
||||||
PrefabInstance:
|
PrefabInstance:
|
||||||
m_ObjectHideFlags: 0
|
m_ObjectHideFlags: 0
|
||||||
@ -19304,6 +19424,170 @@ MeshFilter:
|
|||||||
m_PrefabAsset: {fileID: 0}
|
m_PrefabAsset: {fileID: 0}
|
||||||
m_GameObject: {fileID: 1389934102}
|
m_GameObject: {fileID: 1389934102}
|
||||||
m_Mesh: {fileID: 10202, guid: 0000000000000000e000000000000000, type: 0}
|
m_Mesh: {fileID: 10202, guid: 0000000000000000e000000000000000, type: 0}
|
||||||
|
--- !u!43 &1398298638
|
||||||
|
Mesh:
|
||||||
|
m_ObjectHideFlags: 0
|
||||||
|
m_CorrespondingSourceObject: {fileID: 0}
|
||||||
|
m_PrefabInstance: {fileID: 0}
|
||||||
|
m_PrefabAsset: {fileID: 0}
|
||||||
|
m_Name: Pipe
|
||||||
|
serializedVersion: 10
|
||||||
|
m_SubMeshes:
|
||||||
|
- serializedVersion: 2
|
||||||
|
firstByte: 0
|
||||||
|
indexCount: 0
|
||||||
|
topology: 0
|
||||||
|
baseVertex: 0
|
||||||
|
firstVertex: 0
|
||||||
|
vertexCount: 0
|
||||||
|
localAABB:
|
||||||
|
m_Center: {x: 0, y: 0, z: 0}
|
||||||
|
m_Extent: {x: 0, y: 0, z: 0}
|
||||||
|
m_Shapes:
|
||||||
|
vertices: []
|
||||||
|
shapes: []
|
||||||
|
channels: []
|
||||||
|
fullWeights: []
|
||||||
|
m_BindPose: []
|
||||||
|
m_BoneNameHashes:
|
||||||
|
m_RootBoneNameHash: 0
|
||||||
|
m_BonesAABB: []
|
||||||
|
m_VariableBoneCountWeights:
|
||||||
|
m_Data:
|
||||||
|
m_MeshCompression: 0
|
||||||
|
m_IsReadable: 1
|
||||||
|
m_KeepVertices: 1
|
||||||
|
m_KeepIndices: 1
|
||||||
|
m_IndexFormat: 0
|
||||||
|
m_IndexBuffer:
|
||||||
|
m_VertexData:
|
||||||
|
serializedVersion: 3
|
||||||
|
m_VertexCount: 0
|
||||||
|
m_Channels:
|
||||||
|
- stream: 0
|
||||||
|
offset: 0
|
||||||
|
format: 0
|
||||||
|
dimension: 0
|
||||||
|
- stream: 0
|
||||||
|
offset: 0
|
||||||
|
format: 0
|
||||||
|
dimension: 0
|
||||||
|
- stream: 0
|
||||||
|
offset: 0
|
||||||
|
format: 0
|
||||||
|
dimension: 0
|
||||||
|
- stream: 0
|
||||||
|
offset: 0
|
||||||
|
format: 0
|
||||||
|
dimension: 0
|
||||||
|
- stream: 0
|
||||||
|
offset: 0
|
||||||
|
format: 0
|
||||||
|
dimension: 0
|
||||||
|
- stream: 0
|
||||||
|
offset: 0
|
||||||
|
format: 0
|
||||||
|
dimension: 0
|
||||||
|
- stream: 0
|
||||||
|
offset: 0
|
||||||
|
format: 0
|
||||||
|
dimension: 0
|
||||||
|
- stream: 0
|
||||||
|
offset: 0
|
||||||
|
format: 0
|
||||||
|
dimension: 0
|
||||||
|
- stream: 0
|
||||||
|
offset: 0
|
||||||
|
format: 0
|
||||||
|
dimension: 0
|
||||||
|
- stream: 0
|
||||||
|
offset: 0
|
||||||
|
format: 0
|
||||||
|
dimension: 0
|
||||||
|
- stream: 0
|
||||||
|
offset: 0
|
||||||
|
format: 0
|
||||||
|
dimension: 0
|
||||||
|
- stream: 0
|
||||||
|
offset: 0
|
||||||
|
format: 0
|
||||||
|
dimension: 0
|
||||||
|
- stream: 0
|
||||||
|
offset: 0
|
||||||
|
format: 0
|
||||||
|
dimension: 0
|
||||||
|
- stream: 0
|
||||||
|
offset: 0
|
||||||
|
format: 0
|
||||||
|
dimension: 0
|
||||||
|
m_DataSize: 0
|
||||||
|
_typelessdata:
|
||||||
|
m_CompressedMesh:
|
||||||
|
m_Vertices:
|
||||||
|
m_NumItems: 0
|
||||||
|
m_Range: 0
|
||||||
|
m_Start: 0
|
||||||
|
m_Data:
|
||||||
|
m_BitSize: 0
|
||||||
|
m_UV:
|
||||||
|
m_NumItems: 0
|
||||||
|
m_Range: 0
|
||||||
|
m_Start: 0
|
||||||
|
m_Data:
|
||||||
|
m_BitSize: 0
|
||||||
|
m_Normals:
|
||||||
|
m_NumItems: 0
|
||||||
|
m_Range: 0
|
||||||
|
m_Start: 0
|
||||||
|
m_Data:
|
||||||
|
m_BitSize: 0
|
||||||
|
m_Tangents:
|
||||||
|
m_NumItems: 0
|
||||||
|
m_Range: 0
|
||||||
|
m_Start: 0
|
||||||
|
m_Data:
|
||||||
|
m_BitSize: 0
|
||||||
|
m_Weights:
|
||||||
|
m_NumItems: 0
|
||||||
|
m_Data:
|
||||||
|
m_BitSize: 0
|
||||||
|
m_NormalSigns:
|
||||||
|
m_NumItems: 0
|
||||||
|
m_Data:
|
||||||
|
m_BitSize: 0
|
||||||
|
m_TangentSigns:
|
||||||
|
m_NumItems: 0
|
||||||
|
m_Data:
|
||||||
|
m_BitSize: 0
|
||||||
|
m_FloatColors:
|
||||||
|
m_NumItems: 0
|
||||||
|
m_Range: 0
|
||||||
|
m_Start: 0
|
||||||
|
m_Data:
|
||||||
|
m_BitSize: 0
|
||||||
|
m_BoneIndices:
|
||||||
|
m_NumItems: 0
|
||||||
|
m_Data:
|
||||||
|
m_BitSize: 0
|
||||||
|
m_Triangles:
|
||||||
|
m_NumItems: 0
|
||||||
|
m_Data:
|
||||||
|
m_BitSize: 0
|
||||||
|
m_UVInfo: 0
|
||||||
|
m_LocalAABB:
|
||||||
|
m_Center: {x: 0, y: 0, z: 0}
|
||||||
|
m_Extent: {x: 0, y: 0, z: 0}
|
||||||
|
m_MeshUsageFlags: 0
|
||||||
|
m_BakedConvexCollisionMesh:
|
||||||
|
m_BakedTriangleCollisionMesh:
|
||||||
|
m_MeshMetrics[0]: 1
|
||||||
|
m_MeshMetrics[1]: 1
|
||||||
|
m_MeshOptimizationFlags: 1
|
||||||
|
m_StreamData:
|
||||||
|
serializedVersion: 2
|
||||||
|
offset: 0
|
||||||
|
size: 0
|
||||||
|
path:
|
||||||
--- !u!1 &1402647585
|
--- !u!1 &1402647585
|
||||||
GameObject:
|
GameObject:
|
||||||
m_ObjectHideFlags: 0
|
m_ObjectHideFlags: 0
|
||||||
@ -19362,6 +19646,8 @@ MonoBehaviour:
|
|||||||
OpenFa: {fileID: 1039752002}
|
OpenFa: {fileID: 1039752002}
|
||||||
Gun: {fileID: 919132149155446097, guid: ffc8f56811d7ca145812ba1f6a4be23a, type: 3}
|
Gun: {fileID: 919132149155446097, guid: ffc8f56811d7ca145812ba1f6a4be23a, type: 3}
|
||||||
Hand: {fileID: 1036449735}
|
Hand: {fileID: 1036449735}
|
||||||
|
XFsTransform: {fileID: 1604673292}
|
||||||
|
ShuiguanGameObject: {fileID: 272591050}
|
||||||
--- !u!1001 &1402705621
|
--- !u!1001 &1402705621
|
||||||
PrefabInstance:
|
PrefabInstance:
|
||||||
m_ObjectHideFlags: 0
|
m_ObjectHideFlags: 0
|
||||||
@ -22742,6 +23028,37 @@ Transform:
|
|||||||
m_CorrespondingSourceObject: {fileID: 408378, guid: 74d0d3e646b67204b8f191af25ed2e3e, type: 3}
|
m_CorrespondingSourceObject: {fileID: 408378, guid: 74d0d3e646b67204b8f191af25ed2e3e, type: 3}
|
||||||
m_PrefabInstance: {fileID: 1599886499}
|
m_PrefabInstance: {fileID: 1599886499}
|
||||||
m_PrefabAsset: {fileID: 0}
|
m_PrefabAsset: {fileID: 0}
|
||||||
|
--- !u!1 &1604673291
|
||||||
|
GameObject:
|
||||||
|
m_ObjectHideFlags: 0
|
||||||
|
m_CorrespondingSourceObject: {fileID: 0}
|
||||||
|
m_PrefabInstance: {fileID: 0}
|
||||||
|
m_PrefabAsset: {fileID: 0}
|
||||||
|
serializedVersion: 6
|
||||||
|
m_Component:
|
||||||
|
- component: {fileID: 1604673292}
|
||||||
|
m_Layer: 0
|
||||||
|
m_Name: GameObject
|
||||||
|
m_TagString: Untagged
|
||||||
|
m_Icon: {fileID: 0}
|
||||||
|
m_NavMeshLayer: 0
|
||||||
|
m_StaticEditorFlags: 0
|
||||||
|
m_IsActive: 1
|
||||||
|
--- !u!4 &1604673292
|
||||||
|
Transform:
|
||||||
|
m_ObjectHideFlags: 0
|
||||||
|
m_CorrespondingSourceObject: {fileID: 0}
|
||||||
|
m_PrefabInstance: {fileID: 0}
|
||||||
|
m_PrefabAsset: {fileID: 0}
|
||||||
|
m_GameObject: {fileID: 1604673291}
|
||||||
|
m_LocalRotation: {x: 0, y: 0, z: 0, w: 1}
|
||||||
|
m_LocalPosition: {x: -0.247, y: 0.275, z: -0.57}
|
||||||
|
m_LocalScale: {x: 1, y: 1, z: 1}
|
||||||
|
m_ConstrainProportionsScale: 0
|
||||||
|
m_Children: []
|
||||||
|
m_Father: {fileID: 1855712068}
|
||||||
|
m_RootOrder: 0
|
||||||
|
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
|
||||||
--- !u!1001 &1617380643
|
--- !u!1001 &1617380643
|
||||||
PrefabInstance:
|
PrefabInstance:
|
||||||
m_ObjectHideFlags: 0
|
m_ObjectHideFlags: 0
|
||||||
@ -25125,23 +25442,23 @@ PrefabInstance:
|
|||||||
objectReference: {fileID: 0}
|
objectReference: {fileID: 0}
|
||||||
- target: {fileID: -8679921383154817045, guid: 53b3ada11775bfd4282e07e6e63c968f, type: 3}
|
- target: {fileID: -8679921383154817045, guid: 53b3ada11775bfd4282e07e6e63c968f, type: 3}
|
||||||
propertyPath: m_LocalRotation.w
|
propertyPath: m_LocalRotation.w
|
||||||
value: 0.7071068
|
value: 0.07548644
|
||||||
objectReference: {fileID: 0}
|
objectReference: {fileID: 0}
|
||||||
- target: {fileID: -8679921383154817045, guid: 53b3ada11775bfd4282e07e6e63c968f, type: 3}
|
- target: {fileID: -8679921383154817045, guid: 53b3ada11775bfd4282e07e6e63c968f, type: 3}
|
||||||
propertyPath: m_LocalRotation.x
|
propertyPath: m_LocalRotation.x
|
||||||
value: -0.7071068
|
value: -0.07548641
|
||||||
objectReference: {fileID: 0}
|
objectReference: {fileID: 0}
|
||||||
- target: {fileID: -8679921383154817045, guid: 53b3ada11775bfd4282e07e6e63c968f, type: 3}
|
- target: {fileID: -8679921383154817045, guid: 53b3ada11775bfd4282e07e6e63c968f, type: 3}
|
||||||
propertyPath: m_LocalRotation.y
|
propertyPath: m_LocalRotation.y
|
||||||
value: 0
|
value: 0.7030661
|
||||||
objectReference: {fileID: 0}
|
objectReference: {fileID: 0}
|
||||||
- target: {fileID: -8679921383154817045, guid: 53b3ada11775bfd4282e07e6e63c968f, type: 3}
|
- target: {fileID: -8679921383154817045, guid: 53b3ada11775bfd4282e07e6e63c968f, type: 3}
|
||||||
propertyPath: m_LocalRotation.z
|
propertyPath: m_LocalRotation.z
|
||||||
value: -0
|
value: 0.70306593
|
||||||
objectReference: {fileID: 0}
|
objectReference: {fileID: 0}
|
||||||
- target: {fileID: -8679921383154817045, guid: 53b3ada11775bfd4282e07e6e63c968f, type: 3}
|
- target: {fileID: -8679921383154817045, guid: 53b3ada11775bfd4282e07e6e63c968f, type: 3}
|
||||||
propertyPath: m_LocalEulerAnglesHint.x
|
propertyPath: m_LocalEulerAnglesHint.x
|
||||||
value: 0
|
value: -90
|
||||||
objectReference: {fileID: 0}
|
objectReference: {fileID: 0}
|
||||||
- target: {fileID: -8679921383154817045, guid: 53b3ada11775bfd4282e07e6e63c968f, type: 3}
|
- target: {fileID: -8679921383154817045, guid: 53b3ada11775bfd4282e07e6e63c968f, type: 3}
|
||||||
propertyPath: m_LocalEulerAnglesHint.y
|
propertyPath: m_LocalEulerAnglesHint.y
|
||||||
@ -25149,7 +25466,7 @@ PrefabInstance:
|
|||||||
objectReference: {fileID: 0}
|
objectReference: {fileID: 0}
|
||||||
- target: {fileID: -8679921383154817045, guid: 53b3ada11775bfd4282e07e6e63c968f, type: 3}
|
- target: {fileID: -8679921383154817045, guid: 53b3ada11775bfd4282e07e6e63c968f, type: 3}
|
||||||
propertyPath: m_LocalEulerAnglesHint.z
|
propertyPath: m_LocalEulerAnglesHint.z
|
||||||
value: 0
|
value: 167.744
|
||||||
objectReference: {fileID: 0}
|
objectReference: {fileID: 0}
|
||||||
- target: {fileID: -7511558181221131132, guid: 53b3ada11775bfd4282e07e6e63c968f, type: 3}
|
- target: {fileID: -7511558181221131132, guid: 53b3ada11775bfd4282e07e6e63c968f, type: 3}
|
||||||
propertyPath: m_Materials.Array.data[0]
|
propertyPath: m_Materials.Array.data[0]
|
||||||
@ -25184,6 +25501,11 @@ CapsuleCollider:
|
|||||||
m_Height: 1.2332822
|
m_Height: 1.2332822
|
||||||
m_Direction: 1
|
m_Direction: 1
|
||||||
m_Center: {x: -0.000000059604645, y: -0.00000005960466, z: 0}
|
m_Center: {x: -0.000000059604645, y: -0.00000005960466, z: 0}
|
||||||
|
--- !u!4 &1855712068 stripped
|
||||||
|
Transform:
|
||||||
|
m_CorrespondingSourceObject: {fileID: -8679921383154817045, guid: 53b3ada11775bfd4282e07e6e63c968f, type: 3}
|
||||||
|
m_PrefabInstance: {fileID: 1855712065}
|
||||||
|
m_PrefabAsset: {fileID: 0}
|
||||||
--- !u!114 &1855712071
|
--- !u!114 &1855712071
|
||||||
MonoBehaviour:
|
MonoBehaviour:
|
||||||
m_ObjectHideFlags: 0
|
m_ObjectHideFlags: 0
|
||||||
|
@ -11,6 +11,10 @@ public class XFS : MonoBehaviour
|
|||||||
public Button OpenFa;
|
public Button OpenFa;
|
||||||
public GameObject Gun;
|
public GameObject Gun;
|
||||||
public Transform Hand;
|
public Transform Hand;
|
||||||
|
public Transform XFsTransform;
|
||||||
|
public GameObject ShuiguanGameObject;
|
||||||
|
private GameObject gun;
|
||||||
|
|
||||||
void Start()
|
void Start()
|
||||||
{
|
{
|
||||||
ConnectGun.onClick.AddListener(connectGun);
|
ConnectGun.onClick.AddListener(connectGun);
|
||||||
@ -20,16 +24,18 @@ public class XFS : MonoBehaviour
|
|||||||
|
|
||||||
void connectGun()
|
void connectGun()
|
||||||
{
|
{
|
||||||
GameObject ob = Instantiate(Gun);
|
gun = Instantiate(Gun);
|
||||||
ob.transform.SetParent(Hand);
|
gun.transform.SetParent(Hand);
|
||||||
ob.transform.localRotation = new Quaternion(0, 180, 0, 0);
|
gun.transform.localRotation = new Quaternion(0, 180, 0, 0);
|
||||||
ob.transform.localPosition = new Vector3(0.000419999997f, 0.00138999999f, 0.000569999975f);
|
gun.transform.localPosition = new Vector3(0.000419999997f, 0.00138999999f, 0.000569999975f);
|
||||||
ob.transform.localScale = new Vector3(0.01f, 0.01f, 0.01f);
|
gun.transform.localScale = new Vector3(0.01f, 0.01f, 0.01f);
|
||||||
}
|
}
|
||||||
|
|
||||||
void connectFa()
|
void connectFa()
|
||||||
{
|
{
|
||||||
|
BezierPipe bezier = ShuiguanGameObject.GetComponent<BezierPipe>();
|
||||||
|
bezier.point1 = XFsTransform;
|
||||||
|
bezier.point2 = gun.transform;
|
||||||
}
|
}
|
||||||
|
|
||||||
void openFa()
|
void openFa()
|
||||||
|
925
xiaofang/Assets/yhj/New Scene.unity
Normal file
925
xiaofang/Assets/yhj/New Scene.unity
Normal file
File diff suppressed because one or more lines are too long
7
xiaofang/Assets/yhj/New Scene.unity.meta
Normal file
7
xiaofang/Assets/yhj/New Scene.unity.meta
Normal file
@ -0,0 +1,7 @@
|
|||||||
|
fileFormatVersion: 2
|
||||||
|
guid: 2439f0a68cad1154e93b062a67fe56ba
|
||||||
|
DefaultImporter:
|
||||||
|
externalObjects: {}
|
||||||
|
userData:
|
||||||
|
assetBundleName:
|
||||||
|
assetBundleVariant:
|
189
xiaofang/Assets/yhj/scripts/BezierPipe.cs
Normal file
189
xiaofang/Assets/yhj/scripts/BezierPipe.cs
Normal file
@ -0,0 +1,189 @@
|
|||||||
|
using UnityEngine;
|
||||||
|
using System.Collections.Generic;
|
||||||
|
|
||||||
|
public struct BezierLineSegment
|
||||||
|
{
|
||||||
|
public Vector3 fromPoint;
|
||||||
|
public Vector3 toPoint;
|
||||||
|
public Vector3 controlPoint;
|
||||||
|
public Quaternion fromDir;
|
||||||
|
public Quaternion toDir;
|
||||||
|
|
||||||
|
public void CalculateDir()
|
||||||
|
{
|
||||||
|
fromDir = Quaternion.FromToRotation(Vector3.forward, controlPoint - fromPoint);
|
||||||
|
toDir = Quaternion.FromToRotation(Vector3.forward, toPoint - controlPoint);
|
||||||
|
}
|
||||||
|
|
||||||
|
public bool IsStraight()
|
||||||
|
{
|
||||||
|
return fromDir == toDir;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
[ExecuteInEditMode]
|
||||||
|
public class BezierPipe : MonoBehaviour
|
||||||
|
{
|
||||||
|
|
||||||
|
public float cornerScale = 1f;
|
||||||
|
[Range(1, 100)]
|
||||||
|
public int cornerStep = 10;
|
||||||
|
[Range(2, 100)]
|
||||||
|
public int circleStep = 10;
|
||||||
|
|
||||||
|
public float r = 0.1f;
|
||||||
|
|
||||||
|
public Transform point1;
|
||||||
|
public Vector3 point1Dir = Vector3.up;
|
||||||
|
public Transform point2;
|
||||||
|
public Vector3 point2Dir = Vector3.up;
|
||||||
|
|
||||||
|
public bool update = false;
|
||||||
|
|
||||||
|
public Mesh mesh;
|
||||||
|
List<Vector3> verts = new List<Vector3>();
|
||||||
|
List<int> triangles = new List<int>();
|
||||||
|
private MeshCollider mc;
|
||||||
|
|
||||||
|
// Use this for initialization
|
||||||
|
void Start()
|
||||||
|
{
|
||||||
|
mesh = new Mesh();
|
||||||
|
mesh.name = "Pipe";
|
||||||
|
MeshFilter mf = GetComponent<MeshFilter>();
|
||||||
|
if (mf != null)
|
||||||
|
{
|
||||||
|
mf.sharedMesh = mesh;
|
||||||
|
}
|
||||||
|
mc = GetComponent<MeshCollider>();
|
||||||
|
if (mc != null)
|
||||||
|
{
|
||||||
|
mc.sharedMesh = mesh;
|
||||||
|
}
|
||||||
|
BuildMesh();
|
||||||
|
}
|
||||||
|
|
||||||
|
// Update is called once per frame
|
||||||
|
void Update()
|
||||||
|
{
|
||||||
|
if (update)
|
||||||
|
{
|
||||||
|
BuildMesh();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
void GetCirclePoint(Vector3 pos, Quaternion dir, bool draw)
|
||||||
|
{
|
||||||
|
for (int a = 0; a <= circleStep; a++)
|
||||||
|
{
|
||||||
|
float p = 2 * Mathf.PI * a / circleStep;
|
||||||
|
Vector3 cp = new Vector3(r * Mathf.Cos(p), r * Mathf.Sin(p), 0);
|
||||||
|
cp = dir * cp + pos;
|
||||||
|
//if(draw)
|
||||||
|
// Gizmos.DrawSphere(cp, 0.0005f);
|
||||||
|
cp = transform.worldToLocalMatrix.MultiplyPoint(cp);
|
||||||
|
//cp += transform.position;
|
||||||
|
verts.Add(cp);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
void SetTriangles()
|
||||||
|
{
|
||||||
|
triangles.Clear();
|
||||||
|
for (int i = 0; i < verts.Count - circleStep - 2; i++)
|
||||||
|
{
|
||||||
|
triangles.Add(i);
|
||||||
|
triangles.Add(i + 1);
|
||||||
|
triangles.Add(i + circleStep + 1);
|
||||||
|
triangles.Add(i + circleStep + 1);
|
||||||
|
triangles.Add(i + 1);
|
||||||
|
triangles.Add(i + circleStep + 2);
|
||||||
|
}
|
||||||
|
mesh.triangles = triangles.ToArray();
|
||||||
|
}
|
||||||
|
|
||||||
|
public void BuildMesh()
|
||||||
|
{
|
||||||
|
if (point1 != null && point2 != null)
|
||||||
|
{
|
||||||
|
verts.Clear();
|
||||||
|
float scale = cornerScale;
|
||||||
|
float length = (point1.position - point2.position).magnitude / 4;
|
||||||
|
if (scale > length)
|
||||||
|
{
|
||||||
|
scale = length;
|
||||||
|
}
|
||||||
|
BezierLineSegment[] segments = new BezierLineSegment[3];
|
||||||
|
segments[0].fromPoint = point1.position;
|
||||||
|
point1Dir.Normalize();
|
||||||
|
segments[0].controlPoint = point1.position + point1.rotation * point1Dir * scale;
|
||||||
|
|
||||||
|
segments[2].toPoint = point2.position;
|
||||||
|
point2Dir.Normalize();
|
||||||
|
segments[2].controlPoint = point2.position + point2.rotation * point2Dir * scale;
|
||||||
|
|
||||||
|
segments[1].controlPoint = (segments[0].controlPoint + segments[2].controlPoint) / 2;
|
||||||
|
|
||||||
|
segments[0].toPoint = segments[1].fromPoint = segments[0].controlPoint + (segments[1].controlPoint - segments[0].controlPoint).normalized * scale;
|
||||||
|
segments[1].toPoint = segments[2].fromPoint = segments[2].controlPoint + (segments[1].controlPoint - segments[2].controlPoint).normalized * scale;
|
||||||
|
|
||||||
|
transform.position = segments[1].controlPoint;
|
||||||
|
segments[1].CalculateDir();
|
||||||
|
transform.rotation = segments[1].fromDir;
|
||||||
|
// Debug.Log (transform.eulerAngles);
|
||||||
|
|
||||||
|
foreach (var segment in segments)
|
||||||
|
{
|
||||||
|
segment.CalculateDir();
|
||||||
|
if (segment.IsStraight())
|
||||||
|
{
|
||||||
|
GetCirclePoint(segment.fromPoint, segment.fromDir, true);
|
||||||
|
GetCirclePoint(segment.controlPoint, segment.fromDir, false);
|
||||||
|
GetCirclePoint(segment.toPoint, segment.toDir, true);
|
||||||
|
//Gizmos.DrawLine(segment.fromPoint, segment.controlPoint);
|
||||||
|
//Gizmos.DrawLine(segment.controlPoint, segment.toPoint);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
GetCirclePoint(segment.fromPoint, segment.fromDir, true);
|
||||||
|
Vector3 p1 = segment.fromPoint;
|
||||||
|
for (int s = 1; s < cornerStep; s++)
|
||||||
|
{
|
||||||
|
float t = (float)s / cornerStep;
|
||||||
|
Vector3 p2 = GetBezierPoint(t,segment.fromPoint, segment.controlPoint, segment.toPoint);
|
||||||
|
//Quaternion dir = Quaternion.FromToRotation(Vector3.forward, p2 - p1);
|
||||||
|
Quaternion dir = Quaternion.Lerp(segment.fromDir, segment.toDir, t);
|
||||||
|
GetCirclePoint(p2, dir, false);
|
||||||
|
//Gizmos.DrawLine(p1, p2);
|
||||||
|
p1 = p2;
|
||||||
|
}
|
||||||
|
GetCirclePoint(segment.toPoint, segment.toDir, true);
|
||||||
|
//Gizmos.DrawLine(p1,segment.toPoint);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
mesh.Clear();
|
||||||
|
mesh.vertices = verts.ToArray();
|
||||||
|
SetTriangles();
|
||||||
|
mesh.RecalculateNormals();
|
||||||
|
|
||||||
|
if (mc != null)
|
||||||
|
{
|
||||||
|
mc.sharedMesh = mesh;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
Vector3 GetBezierPoint(float t, Vector3 p0, Vector3 p1, Vector3 p2)
|
||||||
|
{
|
||||||
|
float u = 1f - t;
|
||||||
|
float tt = t * t;
|
||||||
|
float uu = u * u;
|
||||||
|
|
||||||
|
// 计算二次贝塞尔曲线公式
|
||||||
|
Vector3 p = uu * p0; // (1 - t)^2 * P0
|
||||||
|
p += 2 * u * t * p1; // 2 * (1 - t) * t * P1
|
||||||
|
p += tt * p2; // t^2 * P2
|
||||||
|
|
||||||
|
return p;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
11
xiaofang/Assets/yhj/scripts/BezierPipe.cs.meta
Normal file
11
xiaofang/Assets/yhj/scripts/BezierPipe.cs.meta
Normal file
@ -0,0 +1,11 @@
|
|||||||
|
fileFormatVersion: 2
|
||||||
|
guid: ad01dad0cc1e4a04a932125df88f1edd
|
||||||
|
MonoImporter:
|
||||||
|
externalObjects: {}
|
||||||
|
serializedVersion: 2
|
||||||
|
defaultReferences: []
|
||||||
|
executionOrder: 0
|
||||||
|
icon: {instanceID: 0}
|
||||||
|
userData:
|
||||||
|
assetBundleName:
|
||||||
|
assetBundleVariant:
|
Loading…
Reference in New Issue
Block a user