構えの処理を追加
This commit is contained in:
@@ -10,6 +10,8 @@ public class VRInputPunch : MonoBehaviour
|
||||
|
||||
[SerializeField] private XRNode controllerNode = XRNode.RightHand;
|
||||
|
||||
[SerializeField] private VRInputPoseDetector poseDetector;
|
||||
|
||||
[SerializeField] private float minPunchSpeed = 2.0f; //パンチとして判定する最低速度 (m/s)
|
||||
|
||||
[SerializeField] private float damageMultiplier = 10.0f; //ダメージ倍率
|
||||
@@ -56,10 +58,18 @@ public class VRInputPunch : MonoBehaviour
|
||||
if (damageble != null)
|
||||
{
|
||||
DamageInfo info = new DamageInfo();
|
||||
info.amount = speed * damageMultiplier;
|
||||
if(poseDetector.IsPosing)
|
||||
{
|
||||
info.amount = (speed * damageMultiplier) * 2f;
|
||||
info.isPoseBonus = true;
|
||||
}
|
||||
else
|
||||
{
|
||||
info.amount = speed * damageMultiplier;
|
||||
info.isPoseBonus = false;
|
||||
}
|
||||
info.hitPosition = other.transform.position;
|
||||
info.punchDirection = velocity.normalized; //パンチの進む向き
|
||||
info.isPoseBonus = false;
|
||||
damageble.TakeDamage(info);
|
||||
Debug.Log("パンチ成功 ダメージ: {damage:F1}");
|
||||
|
||||
|
||||
Reference in New Issue
Block a user