From cc0923a4cf5a6e2282af4e80be8bc85c4620b42a 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, 24 Dec 2024 11:55:51 +0800 Subject: [PATCH] =?UTF-8?q?=E8=BF=9E=E6=8E=A5=E6=B6=88=E9=98=B2=E5=8A=A8?= =?UTF-8?q?=E4=BD=9Cbug?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- xiaofang/Assets/Scenes/Tmap 1.unity | 96 ++++++++++--------- .../Script/Character/CharacterInturn.cs | 1 + .../Script/Character/Skills/UseSkill.cs | 4 +- xiaofang/Assets/Script/XFS.cs | 21 ++-- 4 files changed, 67 insertions(+), 55 deletions(-) diff --git a/xiaofang/Assets/Scenes/Tmap 1.unity b/xiaofang/Assets/Scenes/Tmap 1.unity index f7367d3c..b26373bd 100644 --- a/xiaofang/Assets/Scenes/Tmap 1.unity +++ b/xiaofang/Assets/Scenes/Tmap 1.unity @@ -704,52 +704,6 @@ Transform: m_CorrespondingSourceObject: {fileID: 470742, guid: 1a983474f33e2a3448edad336be6c954, type: 3} m_PrefabInstance: {fileID: 39914477} m_PrefabAsset: {fileID: 0} ---- !u!1 &41603123 -GameObject: - m_ObjectHideFlags: 0 - m_CorrespondingSourceObject: {fileID: 0} - m_PrefabInstance: {fileID: 0} - m_PrefabAsset: {fileID: 0} - serializedVersion: 6 - m_Component: - - component: {fileID: 41603125} - - component: {fileID: 41603124} - m_Layer: 0 - m_Name: BurstCollisionWorld - m_TagString: Untagged - m_Icon: {fileID: 0} - m_NavMeshLayer: 0 - m_StaticEditorFlags: 0 - m_IsActive: 1 ---- !u!114 &41603124 -MonoBehaviour: - m_ObjectHideFlags: 0 - m_CorrespondingSourceObject: {fileID: 0} - m_PrefabInstance: {fileID: 0} - m_PrefabAsset: {fileID: 0} - m_GameObject: {fileID: 41603123} - m_Enabled: 1 - m_EditorHideFlags: 0 - m_Script: {fileID: 11500000, guid: f1a161c4294214a4fbcb7e9e94800494, type: 3} - m_Name: - m_EditorClassIdentifier: - cellSpans: - m_AlignBytes: 16 ---- !u!4 &41603125 -Transform: - m_ObjectHideFlags: 0 - m_CorrespondingSourceObject: {fileID: 0} - m_PrefabInstance: {fileID: 0} - m_PrefabAsset: {fileID: 0} - m_GameObject: {fileID: 41603123} - 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_RootOrder: 38 - m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} --- !u!1 &51381387 GameObject: m_ObjectHideFlags: 0 @@ -10501,6 +10455,52 @@ MonoBehaviour: Character: {fileID: 382802812} target: {fileID: 1149486592} distanceText: {fileID: 1878753544} +--- !u!1 &556106642 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 556106644} + - component: {fileID: 556106643} + m_Layer: 0 + m_Name: BurstCollisionWorld + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!114 &556106643 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 556106642} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: f1a161c4294214a4fbcb7e9e94800494, type: 3} + m_Name: + m_EditorClassIdentifier: + cellSpans: + m_AlignBytes: 16 +--- !u!4 &556106644 +Transform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 556106642} + 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_RootOrder: 38 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} --- !u!1001 &558790587 PrefabInstance: m_ObjectHideFlags: 0 @@ -21159,6 +21159,7 @@ MonoBehaviour: firewater: {fileID: 8607906409360804035, guid: b5be25eadef55294691fff85129cc656, type: 3} water: {fileID: 0} IShavewater: 0 + CharacterControl: {fileID: 0} UseSkill: {fileID: 0} --- !u!1001 &1402705621 PrefabInstance: @@ -29028,8 +29029,9 @@ MonoBehaviour: XFsTransform: {fileID: 1604673292} ShuiguanGameObject: {fileID: 2057924365745864530} firewater: {fileID: 8607906409360804035, guid: b5be25eadef55294691fff85129cc656, type: 3} - water: {fileID: 0} + water: {fileID: 382802809} IShavewater: 0 + CharacterControl: {fileID: 382802815} UseSkill: {fileID: 382802817} --- !u!1 &1868384262 GameObject: diff --git a/xiaofang/Assets/Script/Character/CharacterInturn.cs b/xiaofang/Assets/Script/Character/CharacterInturn.cs index 2a39dc28..f49d07d4 100644 --- a/xiaofang/Assets/Script/Character/CharacterInturn.cs +++ b/xiaofang/Assets/Script/Character/CharacterInturn.cs @@ -1,5 +1,6 @@ using System.Collections; using System.Collections.Generic; +using UnityEditor.MemoryProfiler; using UnityEngine; using UnityEngine.UI; public class CharacterInturn : MonoBehaviour diff --git a/xiaofang/Assets/Script/Character/Skills/UseSkill.cs b/xiaofang/Assets/Script/Character/Skills/UseSkill.cs index 42ad61bd..416c0f49 100644 --- a/xiaofang/Assets/Script/Character/Skills/UseSkill.cs +++ b/xiaofang/Assets/Script/Character/Skills/UseSkill.cs @@ -40,8 +40,8 @@ public class UseSkill : MonoBehaviour //连接水管 public void Initgun(GameObject ob) { - currentItem = _skill_Pick.Pick(); - currentItem.transform.localRotation = new Quaternion(0, 180, 0, 0); + ob = _skill_Pick.Pick(); + ob.transform.localRotation = new Quaternion(0, 180, 0, 0); } //拾取 diff --git a/xiaofang/Assets/Script/XFS.cs b/xiaofang/Assets/Script/XFS.cs index 0acfbcde..7c55677c 100644 --- a/xiaofang/Assets/Script/XFS.cs +++ b/xiaofang/Assets/Script/XFS.cs @@ -17,26 +17,35 @@ public class XFS : MonoBehaviour public GameObject firewater; public GameObject water; public bool IShavewater=false; - + public CharacterControl CharacterControl; public UseSkill UseSkill; void Start() { instance=this; - ConnectGun.onClick.AddListener((() => { Invoke("connectGun",6f);})); - ConnectFa.onClick.AddListener(() => { Invoke("connectFa", 6f); }); - OpenFa.onClick.AddListener(() => { Invoke("openFa", 6f); }); + ConnectGun.onClick.AddListener((() => + { + CharacterControl.enabled = false; Invoke("connectGun",6f);})); + ConnectFa.onClick.AddListener(() => + { + CharacterControl.enabled = false; Invoke("connectFa", 6f); + }); + OpenFa.onClick.AddListener(() => + { + CharacterControl.enabled = false; Invoke("openFa", 6f); + }); } public void connectGun() { UseSkill.Initgun(Gun); - + CharacterControl.enabled = true; } public void connectFa() { Solver solver = ShuiguanGameObject.GetComponent(); solver.INit(Gun.transform); + CharacterControl.enabled = true; } public void openFa() @@ -45,7 +54,7 @@ public class XFS : MonoBehaviour water.transform.SetParent(Gun.transform); water.transform.localPosition = new Vector3(0, 0, 0); water.transform.localRotation = new Quaternion(0, 180, 0, 0); - + CharacterControl.enabled = true; water.SetActive(false); IShavewater = true;