移动BUG

This commit is contained in:
杨号敬 2024-12-25 17:38:45 +08:00
parent 9df67ea1d6
commit 36f82953a5
6 changed files with 88 additions and 86 deletions

View File

@ -7738,6 +7738,52 @@ MeshCollider:
m_Convex: 0 m_Convex: 0
m_CookingOptions: 30 m_CookingOptions: 30
m_Mesh: {fileID: 7384328630774979640, guid: 00003e04dc9a2534eb207f108c7b0cd3, type: 3} 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 --- !u!1001 &326324319
PrefabInstance: PrefabInstance:
m_ObjectHideFlags: 0 m_ObjectHideFlags: 0
@ -10401,7 +10447,7 @@ Transform:
m_PrefabAsset: {fileID: 0} m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 466450965} m_GameObject: {fileID: 466450965}
m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} m_LocalRotation: {x: 0, y: 0, z: 0, w: 1}
m_LocalPosition: {x: -15.603, y: -3.975, z: -0.207} m_LocalPosition: {x: -17.191, y: -3.282, z: -0.369}
m_LocalScale: {x: 1, y: 1, z: 1} m_LocalScale: {x: 1, y: 1, z: 1}
m_ConstrainProportionsScale: 0 m_ConstrainProportionsScale: 0
m_Children: [] m_Children: []
@ -28020,7 +28066,7 @@ GameObject:
m_Icon: {fileID: 0} m_Icon: {fileID: 0}
m_NavMeshLayer: 0 m_NavMeshLayer: 0
m_StaticEditorFlags: 0 m_StaticEditorFlags: 0
m_IsActive: 1 m_IsActive: 0
--- !u!81 &1707678917 --- !u!81 &1707678917
AudioListener: AudioListener:
m_ObjectHideFlags: 0 m_ObjectHideFlags: 0
@ -29320,52 +29366,6 @@ Transform:
m_CorrespondingSourceObject: {fileID: 458710, guid: 7f0cbeb31df8d5a4e88fad0e1506c186, type: 3} m_CorrespondingSourceObject: {fileID: 458710, guid: 7f0cbeb31df8d5a4e88fad0e1506c186, type: 3}
m_PrefabInstance: {fileID: 1788785149} m_PrefabInstance: {fileID: 1788785149}
m_PrefabAsset: {fileID: 0} m_PrefabAsset: {fileID: 0}
--- !u!1 &1790366129
GameObject:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
serializedVersion: 6
m_Component:
- component: {fileID: 1790366131}
- component: {fileID: 1790366130}
m_Layer: 0
m_Name: BurstCollisionWorld
m_TagString: Untagged
m_Icon: {fileID: 0}
m_NavMeshLayer: 0
m_StaticEditorFlags: 0
m_IsActive: 1
--- !u!114 &1790366130
MonoBehaviour:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 1790366129}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: f1a161c4294214a4fbcb7e9e94800494, type: 3}
m_Name:
m_EditorClassIdentifier:
cellSpans:
m_AlignBytes: 16
--- !u!4 &1790366131
Transform:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 1790366129}
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 &1792217600 --- !u!1001 &1792217600
PrefabInstance: PrefabInstance:
m_ObjectHideFlags: 0 m_ObjectHideFlags: 0
@ -30334,7 +30334,7 @@ MonoBehaviour:
firewater: {fileID: 8607906409360804035, guid: b5be25eadef55294691fff85129cc656, type: 3} firewater: {fileID: 8607906409360804035, guid: b5be25eadef55294691fff85129cc656, type: 3}
water: {fileID: 382802809} water: {fileID: 382802809}
IShavewater: 0 IShavewater: 0
CharacterControl: {fileID: 382802815} CharacterControl: {fileID: 382802816}
UseSkill: {fileID: 382802817} UseSkill: {fileID: 382802817}
--- !u!1 &1868384262 --- !u!1 &1868384262
GameObject: GameObject:
@ -37784,12 +37784,12 @@ RectTransform:
- {fileID: 2613237551621799912} - {fileID: 2613237551621799912}
- {fileID: 2613237552207917862} - {fileID: 2613237552207917862}
m_Father: {fileID: 2613237552014132572} m_Father: {fileID: 2613237552014132572}
m_RootOrder: 1 m_RootOrder: 0
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
m_AnchorMin: {x: 1, y: 0.5} m_AnchorMin: {x: 1, y: 1}
m_AnchorMax: {x: 1, y: 0.5} m_AnchorMax: {x: 1, y: 1}
m_AnchoredPosition: {x: -179.67773, y: -0.00000047721005} m_AnchoredPosition: {x: -142.53113, y: -21.709}
m_SizeDelta: {x: 359.3556, y: 86.836} m_SizeDelta: {x: 285.0624, y: 43.418}
m_Pivot: {x: 0.5, y: 0.5} m_Pivot: {x: 0.5, y: 0.5}
--- !u!1 &2613237551333319514 --- !u!1 &2613237551333319514
GameObject: GameObject:
@ -37936,7 +37936,7 @@ RectTransform:
m_Children: m_Children:
- {fileID: 2613237551753908636} - {fileID: 2613237551753908636}
m_Father: {fileID: 2613237552534885849} m_Father: {fileID: 2613237552534885849}
m_RootOrder: 2 m_RootOrder: 3
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
m_AnchorMin: {x: 0.5, y: 0.5} m_AnchorMin: {x: 0.5, y: 0.5}
m_AnchorMax: {x: 0.5, y: 0.5} m_AnchorMax: {x: 0.5, y: 0.5}
@ -38053,9 +38053,9 @@ RectTransform:
m_Father: {fileID: 2613237551333319509} m_Father: {fileID: 2613237551333319509}
m_RootOrder: 0 m_RootOrder: 0
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
m_AnchorMin: {x: 0.5, y: 0.5} m_AnchorMin: {x: 0, y: 0.5}
m_AnchorMax: {x: 0.5, y: 0.5} m_AnchorMax: {x: 0, y: 0.5}
m_AnchoredPosition: {x: -72.8, y: -17} m_AnchoredPosition: {x: 16, y: 0}
m_SizeDelta: {x: 32, y: 24} m_SizeDelta: {x: 32, y: 24}
m_Pivot: {x: 0.5, y: 0.5} m_Pivot: {x: 0.5, y: 0.5}
--- !u!1 &2613237551621799913 --- !u!1 &2613237551621799913
@ -38193,7 +38193,7 @@ RectTransform:
- {fileID: 2613237552316610349} - {fileID: 2613237552316610349}
- {fileID: 2007442321} - {fileID: 2007442321}
m_Father: {fileID: 2613237552534885849} m_Father: {fileID: 2613237552534885849}
m_RootOrder: 4 m_RootOrder: 5
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
m_AnchorMin: {x: 0, y: 0} m_AnchorMin: {x: 0, y: 0}
m_AnchorMax: {x: 0, y: 0} m_AnchorMax: {x: 0, y: 0}
@ -38368,7 +38368,7 @@ RectTransform:
- {fileID: 2613237552165599673} - {fileID: 2613237552165599673}
- {fileID: 2732192320098954785} - {fileID: 2732192320098954785}
m_Father: {fileID: 2613237552534885849} m_Father: {fileID: 2613237552534885849}
m_RootOrder: 1 m_RootOrder: 2
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
m_AnchorMin: {x: 1, y: 0} m_AnchorMin: {x: 1, y: 0}
m_AnchorMax: {x: 1, y: 0} m_AnchorMax: {x: 1, y: 0}
@ -38403,15 +38403,14 @@ RectTransform:
m_LocalScale: {x: 1, y: 1, z: 1} m_LocalScale: {x: 1, y: 1, z: 1}
m_ConstrainProportionsScale: 0 m_ConstrainProportionsScale: 0
m_Children: m_Children:
- {fileID: 2613237552313206660}
- {fileID: 2613237551333319509} - {fileID: 2613237551333319509}
m_Father: {fileID: 2613237552534885849} m_Father: {fileID: 2613237552534885849}
m_RootOrder: 3 m_RootOrder: 4
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
m_AnchorMin: {x: 0.5, y: 0.5} m_AnchorMin: {x: 1, y: 1}
m_AnchorMax: {x: 0.5, y: 0.5} m_AnchorMax: {x: 1, y: 1}
m_AnchoredPosition: {x: 333.02655, y: 497.5818} m_AnchoredPosition: {x: -626.91345, y: -43.418213}
m_SizeDelta: {x: 1253.8269, y: 86.8364} m_SizeDelta: {x: 1253.8269, y: 86.836426}
m_Pivot: {x: 0.5, y: 0.5} m_Pivot: {x: 0.5, y: 0.5}
--- !u!1 &2613237552014132573 --- !u!1 &2613237552014132573
GameObject: GameObject:
@ -38760,9 +38759,9 @@ RectTransform:
m_Father: {fileID: 2613237551333319509} m_Father: {fileID: 2613237551333319509}
m_RootOrder: 1 m_RootOrder: 1
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
m_AnchorMin: {x: 0.5, y: 0.5} m_AnchorMin: {x: 1, y: 0.5}
m_AnchorMax: {x: 0.5, y: 0.5} m_AnchorMax: {x: 1, y: 0.5}
m_AnchoredPosition: {x: 63.993, y: -16.899952} m_AnchoredPosition: {x: -115.685, y: 0}
m_SizeDelta: {x: 231.37, y: 30} m_SizeDelta: {x: 231.37, y: 30}
m_Pivot: {x: 0.5, y: 0.5} m_Pivot: {x: 0.5, y: 0.5}
--- !u!1 &2613237552207917863 --- !u!1 &2613237552207917863
@ -38870,7 +38869,7 @@ RectTransform:
m_PrefabInstance: {fileID: 0} m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0} m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 2613237552313206661} m_GameObject: {fileID: 2613237552313206661}
m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} m_LocalRotation: {x: -0, y: -0, z: -0, w: 1}
m_LocalPosition: {x: 0, y: 0, z: 0} m_LocalPosition: {x: 0, y: 0, z: 0}
m_LocalScale: {x: 1, y: 1, z: 1} m_LocalScale: {x: 1, y: 1, z: 1}
m_ConstrainProportionsScale: 0 m_ConstrainProportionsScale: 0
@ -38878,12 +38877,12 @@ RectTransform:
- {fileID: 2613237551480729981} - {fileID: 2613237551480729981}
- {fileID: 2613237552227620595} - {fileID: 2613237552227620595}
- {fileID: 1716067986} - {fileID: 1716067986}
m_Father: {fileID: 2613237552014132572} m_Father: {fileID: 2613237552534885849}
m_RootOrder: 0 m_RootOrder: 0
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
m_AnchorMin: {x: 0, y: 0.5} m_AnchorMin: {x: 0.5, y: 1}
m_AnchorMax: {x: 0, y: 0.5} m_AnchorMax: {x: 0.5, y: 1}
m_AnchoredPosition: {x: 330, y: 0.0000064373016} m_AnchoredPosition: {x: 0, y: -43.418}
m_SizeDelta: {x: 653.2156, y: 86.836} m_SizeDelta: {x: 653.2156, y: 86.836}
m_Pivot: {x: 0.5, y: 0.5} m_Pivot: {x: 0.5, y: 0.5}
--- !u!1 &2613237552313206661 --- !u!1 &2613237552313206661
@ -38990,6 +38989,7 @@ RectTransform:
m_LocalScale: {x: 1, y: 1, z: 1} m_LocalScale: {x: 1, y: 1, z: 1}
m_ConstrainProportionsScale: 0 m_ConstrainProportionsScale: 0
m_Children: m_Children:
- {fileID: 2613237552313206660}
- {fileID: 5723411038272961656} - {fileID: 5723411038272961656}
- {fileID: 2613237551956409152} - {fileID: 2613237551956409152}
- {fileID: 2613237551504403798} - {fileID: 2613237551504403798}
@ -43578,7 +43578,7 @@ RectTransform:
- {fileID: 5723411037460924777} - {fileID: 5723411037460924777}
- {fileID: 5723411038422069042} - {fileID: 5723411038422069042}
m_Father: {fileID: 2613237552534885849} m_Father: {fileID: 2613237552534885849}
m_RootOrder: 0 m_RootOrder: 1
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
m_AnchorMin: {x: 1, y: 0.5} m_AnchorMin: {x: 1, y: 0.5}
m_AnchorMax: {x: 1, y: 0.5} m_AnchorMax: {x: 1, y: 0.5}

View File

@ -9,7 +9,7 @@ public class PlayerMovement_Jpystick : MonoBehaviour, IDragHandler
public Transform cameraTransform; // 引用主摄像机的 Transform public Transform cameraTransform; // 引用主摄像机的 Transform
public float moveSpeed = 5f; public float moveSpeed = 5f;
public CharacterControl characterControl; //public CharacterControl characterControl;
private CharacterAin Characterain; private CharacterAin Characterain;
public Camera mainCamera; public Camera mainCamera;
@ -36,7 +36,7 @@ public class PlayerMovement_Jpystick : MonoBehaviour, IDragHandler
public CameraControl cameraControl; public CameraControl cameraControl;
private void Start() private void Start()
{ {
characterControl = GetComponent<CharacterControl>(); //characterControl = GetComponent<CharacterControl>();
Characterain = GetComponent<CharacterAin>(); Characterain = GetComponent<CharacterAin>();
//rb = GetComponent<Rigidbody>(); //rb = GetComponent<Rigidbody>();
Debug.Log("------------------"+rb); Debug.Log("------------------"+rb);

View File

@ -71,7 +71,7 @@ public class Skill_Jump : MonoBehaviour
characterRigidbody.isKinematic = true; characterRigidbody.isKinematic = true;
// 禁用角色的物理移动,防止翻越时移动受影响 // 禁用角色的物理移动,防止翻越时移动受影响
GetComponent<CharacterControl>().enabled = false; GetComponent<PlayerMovement_Jpystick>().enabled = false;
// 让角色移动到翻越后的位置 // 让角色移动到翻越后的位置
StartCoroutine(VaultMovement(hitPoint)); StartCoroutine(VaultMovement(hitPoint));
@ -104,7 +104,7 @@ public class Skill_Jump : MonoBehaviour
// 立即恢复物理控制和碰撞体 // 立即恢复物理控制和碰撞体
characterRigidbody.isKinematic = false; characterRigidbody.isKinematic = false;
characterCollider.enabled = true; characterCollider.enabled = true;
GetComponent<CharacterControl>().enabled = true; GetComponent<PlayerMovement_Jpystick>().enabled = true;
// 确保刚体恢复正常的重力影响 // 确保刚体恢复正常的重力影响
characterRigidbody.velocity = Vector3.zero; // 清除任何残留的速度 characterRigidbody.velocity = Vector3.zero; // 清除任何残留的速度

View File

@ -42,7 +42,7 @@ public class UseSkill : MonoBehaviour
if(currentItem.gameObject.name=="gun") if(currentItem.gameObject.name=="gun")
{ {
float dis= Vector3.Distance(GameObject.Find("player").transform.position, XFS.instance.transform.position); float dis= Vector3.Distance(GameObject.Find("player").transform.position, XFS.instance.transform.position);
if (dis >= 20f) if (dis >= 30f)
{ {
Drop(); Drop();
} }
@ -133,7 +133,7 @@ public class UseSkill : MonoBehaviour
{ {
return; return;
} }
if (Input.GetMouseButtonDown(0)) if (Input.GetMouseButtonDown(0) && !EventSystem.current.IsPointerOverGameObject())
{ {
if (currentItem == null) if (currentItem == null)
{ {
@ -145,7 +145,7 @@ public class UseSkill : MonoBehaviour
} }
if (Input.GetMouseButtonUp(0) && EventSystem.current.IsPointerOverGameObject()) if (Input.GetMouseButtonUp(0) &&! EventSystem.current.IsPointerOverGameObject())
{ {
IsWater = false; IsWater = false;
_skill_Watering.StopWatering(currentItem); _skill_Watering.StopWatering(currentItem);

View File

@ -30,7 +30,7 @@ public class Fire : MonoBehaviour
float timer = 0; float timer = 0;
//private Firestate firestate = Firestate.NotExtinguishFire; //private Firestate firestate = Firestate.NotExtinguishFire;
public UseSkill UseSkill; public UseSkill UseSkill;
public CharacterControl characterControl;//玩家控制器 public PlayerMovement_Jpystick characterControl;//玩家控制器
public Text TimeText; public Text TimeText;
void Start() void Start()
{ {
@ -162,13 +162,14 @@ public class Fire : MonoBehaviour
// 停止火焰 // 停止火焰
public void StopFire() public void StopFire()
{ {
this.characterControl.Restore(); this.characterControl.enabled=true;
this.gameObject.SetActive(false); this.gameObject.SetActive(false);
Debug.Log("火焰已被熄灭"); Debug.Log("火焰已被熄灭");
UseSkill = null; UseSkill = null;
isPlayerInRange = false; // 玩家离开范围 isPlayerInRange = false; // 玩家离开范围
characterControl = null; characterControl = null;
us.FireOUt(); us.FireOUt();
TimeText.gameObject.SetActive(false);
} }
// 当玩家进入火焰范围时触发 // 当玩家进入火焰范围时触发
@ -184,7 +185,7 @@ public class Fire : MonoBehaviour
{ {
Debug.Log(111111111); Debug.Log(111111111);
isPlayerInRange = true; // 玩家进入范围 isPlayerInRange = true; // 玩家进入范围
characterControl = other.GetComponent<CharacterControl>(); characterControl = other.GetComponent<PlayerMovement_Jpystick>();
UseSkill= other.GetComponent<UseSkill>(); UseSkill= other.GetComponent<UseSkill>();
//// 可以调整此处的触发范围 //// 可以调整此处的触发范围
//float playerDistance = Vector3.Distance(other.transform.position, this.transform.position); //float playerDistance = Vector3.Distance(other.transform.position, this.transform.position);
@ -213,6 +214,7 @@ public class Fire : MonoBehaviour
characterControl = null; characterControl = null;
UseSkill= null; UseSkill= null;
us.FireOUt(); us.FireOUt();
TimeText.gameObject.SetActive(false);
} }
} }

View File

@ -17,7 +17,7 @@ public class XFS : MonoBehaviour
public GameObject firewater; public GameObject firewater;
public GameObject water; public GameObject water;
public bool IShavewater=false; public bool IShavewater=false;
public CharacterControl CharacterControl; public PlayerMovement_Jpystick CharacterControl;
public UseSkill UseSkill; public UseSkill UseSkill;
void Start() void Start()
{ {