This commit is contained in:
wulongxiao 2024-12-04 11:08:07 +08:00
commit 14e656915a
8 changed files with 28 additions and 49 deletions

View File

@ -33918,7 +33918,7 @@ GameObject:
- component: {fileID: 5825030608256766515} - component: {fileID: 5825030608256766515}
m_Layer: 0 m_Layer: 0
m_Name: VFX_Fire_01_Big m_Name: VFX_Fire_01_Big
m_TagString: Untagged m_TagString: fire
m_Icon: {fileID: 0} m_Icon: {fileID: 0}
m_NavMeshLayer: 0 m_NavMeshLayer: 0
m_StaticEditorFlags: 0 m_StaticEditorFlags: 0

View File

@ -9656,7 +9656,7 @@ GameObject:
- component: {fileID: 1871290703645314915} - component: {fileID: 1871290703645314915}
m_Layer: 0 m_Layer: 0
m_Name: VFX_Fire_01_Small m_Name: VFX_Fire_01_Small
m_TagString: Untagged m_TagString: fire
m_Icon: {fileID: 0} m_Icon: {fileID: 0}
m_NavMeshLayer: 0 m_NavMeshLayer: 0
m_StaticEditorFlags: 0 m_StaticEditorFlags: 0

View File

@ -2789,7 +2789,6 @@ GameObject:
- component: {fileID: 382802815} - component: {fileID: 382802815}
- component: {fileID: 382802816} - component: {fileID: 382802816}
- component: {fileID: 382802817} - component: {fileID: 382802817}
- component: {fileID: 382802820}
- component: {fileID: 382802819} - component: {fileID: 382802819}
- component: {fileID: 382802818} - component: {fileID: 382802818}
- component: {fileID: 382802821} - component: {fileID: 382802821}
@ -2886,7 +2885,7 @@ MonoBehaviour:
m_Script: {fileID: 11500000, guid: 340618fb82d9f7246a985879a59c7b4d, type: 3} m_Script: {fileID: 11500000, guid: 340618fb82d9f7246a985879a59c7b4d, type: 3}
m_Name: m_Name:
m_EditorClassIdentifier: m_EditorClassIdentifier:
moveSpeed: 1 moveSpeed: 4
mainCamera: {fileID: 1068997306} mainCamera: {fileID: 1068997306}
JumpAbility: 1 JumpAbility: 1
JumpMoveSpeed: 1 JumpMoveSpeed: 1
@ -2968,26 +2967,6 @@ MonoBehaviour:
relativePosition: {x: 0, y: 0, z: 0} relativePosition: {x: 0, y: 0, z: 0}
relativeRotation: {x: 0, y: 0, z: 0} relativeRotation: {x: 0, y: 0, z: 0}
pickUpRange: 2 pickUpRange: 2
--- !u!114 &382802820
MonoBehaviour:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 382802809}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: 776645053b40a604db295f0167ee1a67, type: 3}
m_Name:
m_EditorClassIdentifier:
vaultDistance: 2
vaultHeight: 2
vaultLayerMask:
serializedVersion: 2
m_Bits: 0
vaultForwardDistance: 0.5
vaultUpwardHeight: 1
characterRigidbody: {fileID: 0}
--- !u!114 &382802821 --- !u!114 &382802821
MonoBehaviour: MonoBehaviour:
m_ObjectHideFlags: 0 m_ObjectHideFlags: 0
@ -16301,7 +16280,7 @@ PrefabInstance:
objectReference: {fileID: 0} objectReference: {fileID: 0}
- target: {fileID: -4216859302048453862, guid: 062c3db07b863f644a93bc3f63e6644b, type: 3} - target: {fileID: -4216859302048453862, guid: 062c3db07b863f644a93bc3f63e6644b, type: 3}
propertyPath: m_LocalPosition.y propertyPath: m_LocalPosition.y
value: 0.07 value: 0.54
objectReference: {fileID: 0} objectReference: {fileID: 0}
- target: {fileID: -4216859302048453862, guid: 062c3db07b863f644a93bc3f63e6644b, type: 3} - target: {fileID: -4216859302048453862, guid: 062c3db07b863f644a93bc3f63e6644b, type: 3}
propertyPath: m_LocalPosition.z propertyPath: m_LocalPosition.z

View File

@ -6,9 +6,9 @@ using UnityEngine;
//这个是翻越,懒得改名字了 //这个是翻越,懒得改名字了
public class Skill_Jump : MonoBehaviour public class Skill_Jump : MonoBehaviour
{ {
private CharacterAin CharacterAin; // 用于控制翻越动画 public CharacterAin CharacterAin; // 用于控制翻越动画
public float vaultDistance = 2f; // 角色可以翻越的最大距离 public float vaultDistance = 4f; // 角色可以翻越的最大距离
public float vaultHeight = 2f; // 角色可以翻越的最大高度 public float vaultHeight = 4f; // 角色可以翻越的最大高度
public LayerMask vaultLayerMask; // 用于检测可翻越物体的 Layer public LayerMask vaultLayerMask; // 用于检测可翻越物体的 Layer
public float vaultForwardDistance = 0.5f; // 可调整的翻越前进距离 public float vaultForwardDistance = 0.5f; // 可调整的翻越前进距离
public float vaultUpwardHeight = 1.0f; // 可调整的翻越高度 public float vaultUpwardHeight = 1.0f; // 可调整的翻越高度
@ -19,12 +19,13 @@ public class Skill_Jump : MonoBehaviour
private void Start() private void Start()
{ {
CharacterAin = transform.GetComponent<CharacterAin>(); CharacterAin = transform.Find("newPlayer").GetComponent<CharacterAin>();
characterCollider = GetComponent<Collider>(); characterCollider = GetComponent<Collider>();
characterRigidbody = GetComponent<Rigidbody>(); characterRigidbody = GetComponent<Rigidbody>();
} }
void Update() void Update()
{ {
//
if (Input.GetKeyDown(KeyCode.Space) && !isVaulting) if (Input.GetKeyDown(KeyCode.Space) && !isVaulting)
{ {
Debug.Log("按下翻越"); Debug.Log("按下翻越");
@ -38,9 +39,17 @@ public class Skill_Jump : MonoBehaviour
Debug.Log("正在检测"); Debug.Log("正在检测");
RaycastHit hit; RaycastHit hit;
Debug.DrawRay(transform.position, transform.forward * vaultDistance, Color.red, 2f);
Vector3 rayStartPosition = transform.position + Vector3.up * 0.9f;
Debug.DrawRay(rayStartPosition, transform.forward * vaultDistance, Color.red, 2f);
Physics.Raycast(transform.position, transform.forward, out hit, vaultDistance, vaultLayerMask);
Debug.Log(hit.transform.name);
// 从角色前方向前发射一个射线,检测是否有障碍物 // 从角色前方向前发射一个射线,检测是否有障碍物
if (Physics.Raycast(transform.position, transform.forward, out hit, vaultDistance, vaultLayerMask)) if (Physics.Raycast(transform.position, transform.forward, out hit, vaultDistance, vaultLayerMask))
{ {
Debug.Log("============================"+hit);
// 如果检测到的障碍物高度适合翻越 // 如果检测到的障碍物高度适合翻越
if (hit.collider.bounds.size.y <= vaultHeight) if (hit.collider.bounds.size.y <= vaultHeight)
{ {

View File

@ -1,3 +1,4 @@
using DG.Tweening;
using System.Collections; using System.Collections;
using System.Collections.Generic; using System.Collections.Generic;
using UnityEngine; using UnityEngine;
@ -62,7 +63,9 @@ public class Skill_Pick : MonoBehaviour
// 将物品设置为玩家手部的子对象,并调整其位置和旋转 // 将物品设置为玩家手部的子对象,并调整其位置和旋转
item.transform.SetParent(rightHand, true); // false表示保持物品的世界旋转和位置 item.transform.SetParent(rightHand, true); // false表示保持物品的世界旋转和位置
item.transform.localPosition = relativePosition; // 假设玩家手中有一个默认的持物位置 item.transform.localPosition = relativePosition; // 假设玩家手中有一个默认的持物位置
item.transform.localRotation = Quaternion.Euler(relativeRotation); // ÖØÖÃÐýת item.transform.localRotation = Quaternion.Euler(relativeRotation); // ÖØÖÃÐýת
Debug.Log("^^^^^^^^^^^^^^^^^^^^^^^^^"); Debug.Log("^^^^^^^^^^^^^^^^^^^^^^^^^");
// 更新当前持有的物品 // 更新当前持有的物品

View File

@ -46,6 +46,10 @@ public class UseSkill : MonoBehaviour
Debug.LogError("F"); Debug.LogError("F");
//Debug.LogError(skill_Pick.Pick()); //Debug.LogError(skill_Pick.Pick());
currentItem = _skill_Pick.Pick(); currentItem = _skill_Pick.Pick();
if(currentItem.transform.name == "NoFire")
{
currentItem.transform.Rotate(180f, -80f, -30f);
}
} }
if (Input.GetKeyDown(KeyCode.Q)) if (Input.GetKeyDown(KeyCode.Q))
{ {
@ -53,11 +57,7 @@ public class UseSkill : MonoBehaviour
} }
} }
//·­Ô½£¨Ìø£©
void Jump()
{
}
//È÷Ë® //È÷Ë®
void Skill_Watering() void Skill_Watering()

View File

@ -29,7 +29,8 @@ public class Fire : MonoBehaviour
void Update() void Update()
{ {
MieFire();
MieFire();
} }

View File

@ -21,17 +21,4 @@ public class CharacterAttribute : MonoBehaviour
public string Stats1; public string Stats1;
public string Stats2; public string Stats2;
// Start is called before the first frame update
void Start()
{
}
// Update is called once per frame
void Update()
{
}
} }