去掉玩家攻击功能
This commit is contained in:
@@ -11,28 +11,7 @@ namespace IndianOceanAssets.Engine2_5D
|
|||||||
// Called once per frame
|
// Called once per frame
|
||||||
void Update()
|
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)
|
else if (input.x < 0)
|
||||||
transform.localScale = new Vector3(-Mathf.Abs(transform.localScale.x), transform.localScale.y, transform.localScale.z);
|
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
|
// Executes the sword slash logic
|
||||||
|
|||||||
@@ -27,14 +27,14 @@ EditorUserSettings:
|
|||||||
value: 5300055151055f5a5e0c0f27477708444515192b287124367c791f30b3b9616d
|
value: 5300055151055f5a5e0c0f27477708444515192b287124367c791f30b3b9616d
|
||||||
flags: 0
|
flags: 0
|
||||||
RecentlyUsedSceneGuid-7:
|
RecentlyUsedSceneGuid-7:
|
||||||
value: 0209025f575750595c57092149765d444e4e49727e7c7068757b1c65b6e36c3b
|
|
||||||
flags: 0
|
|
||||||
RecentlyUsedSceneGuid-8:
|
|
||||||
value: 5a5757560101590a5d0c0e24427b5d44434e4c7a7b7a23677f2b4565b7b5353a
|
value: 5a5757560101590a5d0c0e24427b5d44434e4c7a7b7a23677f2b4565b7b5353a
|
||||||
flags: 0
|
flags: 0
|
||||||
RecentlyUsedSceneGuid-9:
|
RecentlyUsedSceneGuid-8:
|
||||||
value: 5a55515156575a0b0f56592346260f444f16197c7e7f24697d2a4a32b1b0353e
|
value: 5a55515156575a0b0f56592346260f444f16197c7e7f24697d2a4a32b1b0353e
|
||||||
flags: 0
|
flags: 0
|
||||||
|
RecentlyUsedSceneGuid-9:
|
||||||
|
value: 0209025f575750595c57092149765d444e4e49727e7c7068757b1c65b6e36c3b
|
||||||
|
flags: 0
|
||||||
UnityEditor.ShaderGraph.Blackboard:
|
UnityEditor.ShaderGraph.Blackboard:
|
||||||
value: 18135939215a0a5004000b0e15254b524c030a3f2964643d120d1230e9e93a3fd6e826abbd2e2d293c4ead313b08042de6030a0afa240c0d020be94c4ba75e435d8715fa32c70d15d11612dacc11fee5d3c5d1fe9ab1bf968e93e2ffcbc3e7e2f0b3ffe0e8b0be9af8ffaeffff8e85dd8390e3949c8899daa7
|
value: 18135939215a0a5004000b0e15254b524c030a3f2964643d120d1230e9e93a3fd6e826abbd2e2d293c4ead313b08042de6030a0afa240c0d020be94c4ba75e435d8715fa32c70d15d11612dacc11fee5d3c5d1fe9ab1bf968e93e2ffcbc3e7e2f0b3ffe0e8b0be9af8ffaeffff8e85dd8390e3949c8899daa7
|
||||||
flags: 0
|
flags: 0
|
||||||
|
|||||||
Reference in New Issue
Block a user