diff --git a/xiaofang/Assets/Scenes/Tmap 1.unity b/xiaofang/Assets/Scenes/Tmap 1.unity index a202c066..66d99559 100644 --- a/xiaofang/Assets/Scenes/Tmap 1.unity +++ b/xiaofang/Assets/Scenes/Tmap 1.unity @@ -7738,52 +7738,6 @@ MeshCollider: m_Convex: 0 m_CookingOptions: 30 m_Mesh: {fileID: 7384328630774979640, guid: 00003e04dc9a2534eb207f108c7b0cd3, type: 3} ---- !u!1 &314694553 -GameObject: - m_ObjectHideFlags: 0 - m_CorrespondingSourceObject: {fileID: 0} - m_PrefabInstance: {fileID: 0} - m_PrefabAsset: {fileID: 0} - serializedVersion: 6 - m_Component: - - component: {fileID: 314694555} - - component: {fileID: 314694554} - m_Layer: 0 - m_Name: BurstCollisionWorld - m_TagString: Untagged - m_Icon: {fileID: 0} - m_NavMeshLayer: 0 - m_StaticEditorFlags: 0 - m_IsActive: 1 ---- !u!114 &314694554 -MonoBehaviour: - m_ObjectHideFlags: 0 - m_CorrespondingSourceObject: {fileID: 0} - m_PrefabInstance: {fileID: 0} - m_PrefabAsset: {fileID: 0} - m_GameObject: {fileID: 314694553} - m_Enabled: 1 - m_EditorHideFlags: 0 - m_Script: {fileID: 11500000, guid: f1a161c4294214a4fbcb7e9e94800494, type: 3} - m_Name: - m_EditorClassIdentifier: - cellSpans: - m_AlignBytes: 16 ---- !u!4 &314694555 -Transform: - m_ObjectHideFlags: 0 - m_CorrespondingSourceObject: {fileID: 0} - m_PrefabInstance: {fileID: 0} - m_PrefabAsset: {fileID: 0} - m_GameObject: {fileID: 314694553} - 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 &326324319 PrefabInstance: m_ObjectHideFlags: 0 @@ -8797,7 +8751,7 @@ MonoBehaviour: joystick: {fileID: 1221713539} cameraTransform: {fileID: 1068997307} moveSpeed: 5 - characterControl: {fileID: 382802815} + DragTheScreen: {fileID: 1490008725} mainCamera: {fileID: 1068997306} rb: {fileID: 382802811} normalFOV: 60 @@ -25711,6 +25665,52 @@ Transform: m_CorrespondingSourceObject: {fileID: 434342, guid: dae965d9ed8802048877e54ec2f0be78, type: 3} m_PrefabInstance: {fileID: 1517804048} m_PrefabAsset: {fileID: 0} +--- !u!1 &1518257098 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 1518257100} + - component: {fileID: 1518257099} + m_Layer: 0 + m_Name: BurstCollisionWorld + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!114 &1518257099 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1518257098} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: f1a161c4294214a4fbcb7e9e94800494, type: 3} + m_Name: + m_EditorClassIdentifier: + cellSpans: + m_AlignBytes: 16 +--- !u!4 &1518257100 +Transform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1518257098} + 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 &1521737075 GameObject: m_ObjectHideFlags: 0 diff --git a/xiaofang/Assets/Script/Character/PlayerMovement_Jpystick.cs b/xiaofang/Assets/Script/Character/PlayerMovement_Jpystick.cs index 36b09041..25fc3f65 100644 --- a/xiaofang/Assets/Script/Character/PlayerMovement_Jpystick.cs +++ b/xiaofang/Assets/Script/Character/PlayerMovement_Jpystick.cs @@ -9,6 +9,7 @@ public class PlayerMovement_Jpystick : MonoBehaviour, IDragHandler public Transform cameraTransform; // 引用主摄像机的 Transform public float moveSpeed = 5f; + public DragTheScreen DragTheScreen; //public CharacterControl characterControl; private CharacterAin Characterain; diff --git a/xiaofang/Assets/Script/Character/Skills/Skill_Jump.cs b/xiaofang/Assets/Script/Character/Skills/Skill_Jump.cs index 5eddcbc1..409dfe23 100644 --- a/xiaofang/Assets/Script/Character/Skills/Skill_Jump.cs +++ b/xiaofang/Assets/Script/Character/Skills/Skill_Jump.cs @@ -71,7 +71,7 @@ public class Skill_Jump : MonoBehaviour characterRigidbody.isKinematic = true; // 禁用角色的物理移动,防止翻越时移动受影响 - GetComponent().enabled = false; + GetComponent().DragTheScreen.enabled = false; // 让角色移动到翻越后的位置 StartCoroutine(VaultMovement(hitPoint)); @@ -104,7 +104,7 @@ public class Skill_Jump : MonoBehaviour // 立即恢复物理控制和碰撞体 characterRigidbody.isKinematic = false; characterCollider.enabled = true; - GetComponent().enabled = true; + GetComponent().DragTheScreen.enabled = true; // 确保刚体恢复正常的重力影响 characterRigidbody.velocity = Vector3.zero; // 清除任何残留的速度 diff --git a/xiaofang/Assets/Script/Item/Fire.cs b/xiaofang/Assets/Script/Item/Fire.cs index 35fce141..70d4e348 100644 --- a/xiaofang/Assets/Script/Item/Fire.cs +++ b/xiaofang/Assets/Script/Item/Fire.cs @@ -143,6 +143,7 @@ public class Fire : MonoBehaviour // 如果松开按键或者离开范围,重置计时 holdTime = 0f; isExtinguishing = false; + TimeText.gameObject.SetActive(false); // 恢复玩家控制器 if (!Input.GetMouseButton(0)) EnablePlayerControl(); } @@ -162,14 +163,14 @@ public class Fire : MonoBehaviour // 停止火焰 public void StopFire() { - this.characterControl.enabled=true; + this.characterControl.DragTheScreen.enabled=true; this.gameObject.SetActive(false); Debug.Log("火焰已被熄灭"); UseSkill = null; isPlayerInRange = false; // 玩家离开范围 characterControl = null; us.FireOUt(); - TimeText.gameObject.SetActive(false); + TimeText.gameObject.SetActive(false); } // 当玩家进入火焰范围时触发 @@ -212,7 +213,8 @@ public class Fire : MonoBehaviour { isPlayerInRange = false; // 玩家离开范围 characterControl = null; - UseSkill= null; + characterControl.DragTheScreen.enabled = true; + UseSkill = null; us.FireOUt(); TimeText.gameObject.SetActive(false); } @@ -223,7 +225,7 @@ public class Fire : MonoBehaviour { if (characterControl != null) { - characterControl.enabled = false; + characterControl.DragTheScreen.enabled = false; } } @@ -232,7 +234,7 @@ public class Fire : MonoBehaviour { if (characterControl != null) { - characterControl.enabled = true; + characterControl.DragTheScreen.enabled = true; } } } diff --git a/xiaofang/Assets/Script/XFS.cs b/xiaofang/Assets/Script/XFS.cs index 0736aaa0..a4c8026c 100644 --- a/xiaofang/Assets/Script/XFS.cs +++ b/xiaofang/Assets/Script/XFS.cs @@ -26,17 +26,17 @@ public class XFS : MonoBehaviour ConnectGun.onClick.AddListener((() => { PLayerLook(); - CharacterControl.enabled = false; Invoke("connectGun",6f);})); + CharacterControl.DragTheScreen.enabled = false; Invoke("connectGun",6f);})); ConnectFa.onClick.AddListener(() => { PLayerLook(); ShuiguanGameObject.SetActive(true); - CharacterControl.enabled = false; Invoke("connectFa", 6f); + CharacterControl.DragTheScreen.enabled = false; Invoke("connectFa", 6f); }); OpenFa.onClick.AddListener(() => { PLayerLook(); - CharacterControl.enabled = false; Invoke("openFa", 6f); + CharacterControl.DragTheScreen.enabled = false; Invoke("openFa", 6f); }); } @@ -48,16 +48,16 @@ public class XFS : MonoBehaviour public void connectGun() { //UseSkill.Initgun(Gun); - CharacterControl.enabled = true; - + CharacterControl.DragTheScreen.enabled = true; + } public void connectFa() { Solver solver = ShuiguanGameObject.GetComponent(); solver.INit(Gun.transform); - CharacterControl.enabled = true; - + CharacterControl.DragTheScreen.enabled = true; + } public void openFa() @@ -70,7 +70,7 @@ public class XFS : MonoBehaviour water.SetActive(false); IShavewater = true; UseSkill.Initgun(); - + CharacterControl.DragTheScreen.enabled = true; } // Update is called once per frame void Update()