去掉玩家攻击功能

This commit is contained in:
2026-07-05 20:16:12 +08:00
parent aab515c1f8
commit 567ef641b0
3 changed files with 6 additions and 31 deletions
@@ -11,28 +11,7 @@ namespace IndianOceanAssets.Engine2_5D
// Called once per frame
void Update()
{
// Check if attack key is pressed
if (Input.GetKeyDown(attackKeyCode)) // Left-click
{
// Create a ray from the camera to the mouse position
Ray ray = Camera.main.ScreenPointToRay(Input.mousePosition);
// Raycast to ground layer to find target point
if (Physics.Raycast(ray, out RaycastHit hit, 100f, groundLayer))
{
Vector3 targetPoint = hit.point;
// Instantiate projectile at shooter's position
GameObject projectile = Instantiate(projectilePrefab, transform.position, Quaternion.identity);
// Set projectile's target point
projectile.GetComponent<Projectile>().SetTarget(targetPoint);
// Flip shooter sprite based on target direction
if (hit.point.x > transform.position.x)
transform.localScale = new Vector3(Mathf.Abs(transform.localScale.x), transform.localScale.y, transform.localScale.z);
else
transform.localScale = new Vector3(-Mathf.Abs(transform.localScale.x), transform.localScale.y, transform.localScale.z);
}
}
// 攻击输入已移除(由灵灯系统替代)
}
}
}
@@ -37,11 +37,7 @@ namespace IndianOceanAssets.Engine2_5D
else if (input.x < 0)
transform.localScale = new Vector3(-Mathf.Abs(transform.localScale.x), transform.localScale.y, transform.localScale.z);
// Trigger slash when attack key is pressed
if (Input.GetKeyDown(attackKeyCode))
{
Slash();
}
// 攻击输入已移除(由灵灯系统替代)
}
// Executes the sword slash logic
+4 -4
View File
@@ -27,14 +27,14 @@ EditorUserSettings:
value: 5300055151055f5a5e0c0f27477708444515192b287124367c791f30b3b9616d
flags: 0
RecentlyUsedSceneGuid-7:
value: 0209025f575750595c57092149765d444e4e49727e7c7068757b1c65b6e36c3b
flags: 0
RecentlyUsedSceneGuid-8:
value: 5a5757560101590a5d0c0e24427b5d44434e4c7a7b7a23677f2b4565b7b5353a
flags: 0
RecentlyUsedSceneGuid-9:
RecentlyUsedSceneGuid-8:
value: 5a55515156575a0b0f56592346260f444f16197c7e7f24697d2a4a32b1b0353e
flags: 0
RecentlyUsedSceneGuid-9:
value: 0209025f575750595c57092149765d444e4e49727e7c7068757b1c65b6e36c3b
flags: 0
UnityEditor.ShaderGraph.Blackboard:
value: 18135939215a0a5004000b0e15254b524c030a3f2964643d120d1230e9e93a3fd6e826abbd2e2d293c4ead313b08042de6030a0afa240c0d020be94c4ba75e435d8715fa32c70d15d11612dacc11fee5d3c5d1fe9ab1bf968e93e2ffcbc3e7e2f0b3ffe0e8b0be9af8ffaeffff8e85dd8390e3949c8899daa7
flags: 0