去掉玩家攻击功能
This commit is contained in:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user