This commit is contained in:
杨号敬 2024-12-25 18:02:44 +08:00
parent 36f82953a5
commit 999159c80b
5 changed files with 65 additions and 62 deletions

View File

@ -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

View File

@ -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;

View File

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

View File

@ -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;
}
}
}

View File

@ -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>();
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()