From 520b78d60a68e5f84e471074445830944e5af43c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=9D=A8=E5=8F=B7=E6=95=AC?= <153802103@qq.com> Date: Tue, 17 Dec 2024 12:00:17 +0800 Subject: [PATCH] =?UTF-8?q?=E6=B6=88=E9=98=B2=E6=B0=B4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- xiaofang/Assets/Scenes/Tmap 1.unity | 333 ++++++++++++++-------------- xiaofang/Assets/Script/XFS.cs | 19 +- 2 files changed, 178 insertions(+), 174 deletions(-) diff --git a/xiaofang/Assets/Scenes/Tmap 1.unity b/xiaofang/Assets/Scenes/Tmap 1.unity index 5fddf61e..f6e897b5 100644 --- a/xiaofang/Assets/Scenes/Tmap 1.unity +++ b/xiaofang/Assets/Scenes/Tmap 1.unity @@ -3697,7 +3697,7 @@ MonoBehaviour: point2: {fileID: 0} point2Dir: {x: 0, y: 1, z: 0} update: 1 - mesh: {fileID: 1398298638} + mesh: {fileID: 1666991734} --- !u!65 &272591052 BoxCollider: m_ObjectHideFlags: 0 @@ -3760,7 +3760,7 @@ MeshFilter: m_PrefabInstance: {fileID: 0} m_PrefabAsset: {fileID: 0} m_GameObject: {fileID: 272591050} - m_Mesh: {fileID: 1398298638} + m_Mesh: {fileID: 1666991734} --- !u!4 &272591055 Transform: m_ObjectHideFlags: 0 @@ -19424,170 +19424,6 @@ MeshFilter: m_PrefabAsset: {fileID: 0} m_GameObject: {fileID: 1389934102} 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 GameObject: m_ObjectHideFlags: 0 @@ -19648,6 +19484,7 @@ MonoBehaviour: Hand: {fileID: 1036449735} XFsTransform: {fileID: 1604673292} ShuiguanGameObject: {fileID: 272591050} + firewater: {fileID: 7804708754028199847, guid: 04864ac382607a04596879ef7fdc34cc, type: 3} --- !u!1001 &1402705621 PrefabInstance: m_ObjectHideFlags: 0 @@ -23475,6 +23312,170 @@ MonoBehaviour: m_OnClick: m_PersistentCalls: m_Calls: [] +--- !u!43 &1666991734 +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!64 &1669431738 MeshCollider: m_ObjectHideFlags: 0 diff --git a/xiaofang/Assets/Script/XFS.cs b/xiaofang/Assets/Script/XFS.cs index 20a1c279..16ba3c31 100644 --- a/xiaofang/Assets/Script/XFS.cs +++ b/xiaofang/Assets/Script/XFS.cs @@ -14,15 +14,15 @@ public class XFS : MonoBehaviour public Transform XFsTransform; public GameObject ShuiguanGameObject; private GameObject gun; - + public GameObject firewater; void Start() { - ConnectGun.onClick.AddListener(connectGun); - ConnectFa.onClick.AddListener(connectFa); - OpenFa.onClick.AddListener(openFa); + ConnectGun.onClick.AddListener((() => { Invoke("connectGun",6f);})); + ConnectFa.onClick.AddListener(() => { Invoke("connectFa", 6f); }); + OpenFa.onClick.AddListener(() => { Invoke("openFa", 6f); }); } - void connectGun() + public void connectGun() { gun = Instantiate(Gun); gun.transform.SetParent(Hand); @@ -31,16 +31,19 @@ public class XFS : MonoBehaviour gun.transform.localScale = new Vector3(0.01f, 0.01f, 0.01f); } - void connectFa() + public void connectFa() { BezierPipe bezier = ShuiguanGameObject.GetComponent(); bezier.point1 = XFsTransform; bezier.point2 = gun.transform; } - void openFa() + public void openFa() { - + GameObject ob = Instantiate(firewater); + ob.transform.SetParent(gun.transform); + ob.transform.localPosition = new Vector3(0, 0, 0); + ob.transform.localRotation = new Quaternion(0, 180, 0, 0); } // Update is called once per frame void Update()